<script src="__PUBLIC__/js/jquery.datePicker-min.js" type="text/javascript"></script>
<link href="__PUBLIC__/js/datePicker.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript">
$(document).ready(function(){
	$("#typeid").change(function(){
		var id=this.value;
		ch_type(id);
	});
	$('.showend_job').datePicker({clickInput:true});
	var typeid=$("#typeid").val();
	if(typeid!=0){
		ch_type(typeid);
	}
	$("#picurl").change(function(){
		$("#picurl_img").attr("src",this.value);
	});
});
</script>
<div class="mulu">
	<a href="__APP__/">Home</a> > <a href="__APP__/Cp/index">Control Panel</a> > 
	<a href="__APP__/Cp/my_art/">Post Articles</a>
</div>
<div class="right-neirong">
    <div class="clear">
    </div>
    <div class="right-messages">
        <div class="right-title">
            <h3 style="margin:0;">Post Articles</h3>
        </div>
        <div class="list">
            <form action="__URL__/add_art" method="post" enctype="multipart/form-data">
            	<if condition="$data['id']"><input type="hidden" name="id" value="{$data['id']}"></if>
            	<fieldset>
				<legend>Basic Elements:</legend>
					<div style="float:left; width:469px;">
	            	<p>
	            		<label for="title">Title:</label><input type="text" name="title" id="title" value="{$data['title']}" style="width:300px;">
					</p>
	            	<p>
	            		<label for="filename">Filename:</label><input type="text" name="filename" id="filename" value="{$data['filename']}" />
					</p>
					<p>
						<label for="picurl">CoverImage:</label><input type="file" name="picurl" id="picurl" style="width:300px;">
	            	</p>
					<p><label for="showend_job">Valid for</label>
						<input type="text" name="showstart" id="showend_job" class="showend_job" style="width:80px;" value="{$data['showstart']|toDate='d/m/Y'}">
						---> <input type="text" name="showend" id="showend_job" class="showend_job" style="width:80px;" value="{$data['showend']|toDate='d/m/Y'}">
					</p>
					<p>
						<label for="flag">Attribute</label>
						<volist name="flag" id="v">
							<input type="checkbox" value="{$v['att']}" name="flag[]">{$v['attname']}   
						</volist>
					</p>
					</div>
					
					<div style="width:200px; float:left;">
						<img src="{$data['picurl']}" id="picurl_img">	
					</div>
				</fieldset>
				<fieldset>
				<legend>Select Industries:</legend>
					<p>
						<label for="typeid">Industries:</label>
						<select id="typeid" name="typeid">
							<option value="0">---Select Main Category---</option>
							<volist name="class_tree" id="v">
								<if condition="$v['ispart'] eq 1">
									<optgroup label="{$v['typename']}">
										<volist name="v['_son']" id="vs">
											<option value="{$v['channeltype']}_{$vs['id']}"{$vs['id']|selected=$data['typeid']}>{$vs['typename']}</option>
										</volist>
									</optgroup>
								<else/>
									<option value="{$v['channeltype']}_{$v['id']}"{$v['id']|selected=$data['typeid']}>{$v['typename']}</option>
								</if>
														
							</volist>
						</select>
					</p>
					<p>
						<label for="typeid2">Second<br>Category:</label>
						<select id="typeid2" name="typeid2" size="5" >
							<option value="0">---Select Second Category---</option>
							<volist name="class_tree" id="v">
								<if condition="$v['ispart'] eq 1">
									<optgroup label="{$v['typename']}">
										<volist name="v['_son']" id="vs">
											<option value="{$vs['id']}">{$vs['typename']}</option>
										</volist>
									</optgroup>
								<else/>
									<option value="{$v['id']}">{$v['typename']}</option>
								</if>
														
							</volist>
						</select>
					</p>
				</fieldset>
				<fieldset>
					<legend>Articles info:</legend>
					<p><label for="my_content">Summary:</label>
						<textarea cols="50" rows="5" name="my_content" id="my_content">{$data['my_content']|br2nl}</textarea>
					</p>
					<p><label for="content">Content:</label>
						<textarea cols="50" rows="10" name="content" id="content">{$data['content']['content']|br2nl}</textarea>
					</p>
				</fieldset>
				<p>
					<input type="submit" value="Submit">            
					<input type="reset" value="Reset">            
				</p>
            </form>
        </div>
    </div>
</div>
<div class="clear"></div>


